package com.loukou.lkt.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.loukou.lkt.lkt.resp.RespDto;
import com.loukou.lkt.lkt.service.PoPurchaseOrderService;


/**
 * 采购接口
 * @author wr
 *
 */
@Controller
@RequestMapping("/api/purchaseorder")
public class PurchaseOrderController{
	
	@Autowired
	private PoPurchaseOrderService poPurchaseOrderService;
	
	//推送采购出库到WMS(手动推送)
	@RequestMapping(value="/sendpurchaseordertowms", method=RequestMethod.POST)
	@ResponseBody
    public RespDto<String> sendPurchaseOrderToWms(@RequestBody int purchaseOrderId){
		RespDto<String> resp = new RespDto<String>();
		if (purchaseOrderId<=0) {
			resp.setCode(400);
			resp.setMsg("参数有误");
			return resp;
		}
		
		poPurchaseOrderService.sendPurchaseOrderToWms(purchaseOrderId);
        return resp;
    }
}
